package com.hgyc.mom.wms.entity;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.*;

import com.hgyc.mom.common.annotation.Excel;
import com.hgyc.mom.core.annotation.DictColumn;
import com.hgyc.mom.core.annotation.TableDict;
import com.hgyc.mom.core.mybatis.EQ;
import com.hgyc.mom.core.mybatis.Like;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * <p>
 * 物料入库单行
 * </p>
 *
 * @author fwj
 * @since 2025-09-29
 */
@Data
@TableName("wms_purchase_receipt_detail")
@Schema(name="物料入库单行对象", description="物料入库单行对象")
public class WmsPurchaseReceiptDetail implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    private Long id;

    @Schema(description = "来料单ID")
    private Long receiptId;

    @Schema(description = "采购单明细ID")
    private Long purchaseDetailId;

    @Excel(name = "状态")
    @EQ
    @Schema(description = "状态")
    private String status;

    @Excel(name = "物料ID")
    @Schema(description = "物料ID")
    @TableDict(table = "base_material", key = "id" , columns = {
            @DictColumn(name ="material_code", alias = "materialCode"),
            @DictColumn(name = "material_name", alias = "materialName")
    })
    private Long materialId;

    @Excel(name = "采购数量")
    @Schema(description = "采购数量")
    private BigDecimal purchaseQty;

    @Excel(name = "预收数量")
    @Schema(description = "预收数量")
    private BigDecimal advanceQty;

    @Excel(name = "赠品数")
    @Schema(description = "赠品数")
    private BigDecimal giftQty;

    @Excel(name = "实收数量")
    @Schema(description = "实收数量")
    private BigDecimal actuallyQty;

    @Excel(name = "待送检数")
    @Schema(description = "待送检数")
    private BigDecimal toInspectQty;

    @Excel(name = "已送检数")
    @Schema(description = "已送检数")
    private BigDecimal inspectedQty;

    @Excel(name = "订单剩余量")
    @Schema(description = "订单剩余量")
    private BigDecimal orderSurplus;

    @Schema(description = "退料数量")
    private BigDecimal returnQty;

    @Excel(name = "入库批次号")
    @Schema(description = "入库批次号")
    private String lotNo;

    @Excel(name = "生产日期")
    @Schema(description = "生产日期")
    private LocalDate productionDate;

    @Excel(name = "保质期", readConverterExp = "天=")
    @Schema(description = "保质期（天）")
    private Long shelfLifeDays;

    @Schema(description = "库位ID")
    private Long locationId;

    @Excel(name = "备注")
    @Schema(description = "备注")
    private String remark;

    @Excel(name = "质检结果")
    @Schema(description = "质检结果")
    private String checkResult;

    @Schema(description = "关联质检单")
    private Long qcOrderId;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建者")
    private Long createBy;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "更新者")
    private Long updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

}
